package cn.iune.apptest;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.iune.backcenter.authen.ISaOppersonService;
import cn.iune.backcenter.authen.SaOpperson;

@Transactional
@Service
public class ServiceComponentTestImpl implements IServiceComponentTest {


	@Autowired
	private ISaOppersonService personService;

	public ServiceComponentTestImpl() {
		System.out.println("ServiceComponentTest-->>...");
	}
	
	public SaOpperson insertTest() {
		SaOpperson person = new SaOpperson();
		person.setsID(String.valueOf(System.currentTimeMillis()));
		person.setVersion(0);
		personService.insert(person);
		return person;
	}
	
	@Transactional
	public void insertTest2(String id) {
		this.insertTest();
		
		
		SaOpperson person = new SaOpperson();
		person.setsID(id);
		person.setVersion(0);
		personService.insert(person);
	}
	
	public List<SaOpperson> getAll() {
		return personService.getAll();
	}
}
